<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:o="http://openfaces.org/"
	xmlns:s="http://jboss.com/products/seam/taglib"
	template="/WEB-INF/esquema/plantillasimple.xhtml">

	<ui:define name="body">
		<ui:include src="includes/attachedFilesPanel.xhtml" />
		<ui:decorate template="/WEB-INF/esquema/permitTemplate.xhtml">
			<ui:define name="mainControls">
				<h:outputText value="Opciones" />
				<h:outputText value="     " />
				<h:panelGroup>
					<o:commandButton value="#{messages['FINISH']}" onclick="finish();" />
				</h:panelGroup>
			</ui:define>
			
			<ui:define name="extraControls">
				<h:form>
					<a4j:commandButton
						value="#{messages['options.view_request']}"
						reRender="vrp:viewRequestPanel"
						oncomplete="#{rich:component('vrp:viewRequestPanel')}.show()">
						<f:setPropertyActionListener target="#{operationPermitHelper.renderViewRequestPanel}" value="#{true}"/>
					</a4j:commandButton>
					
					<a4j:commandButton value="#{messages['intro2.attacheddocs']}"
					oncomplete="#{rich:component('attachedFilesPanel')}.show()">
					</a4j:commandButton>
				</h:form>
			</ui:define>

			<ui:define name="title">
				<div align="center">
					<br /> <strong>#{messages['operation_permit.start_header']}</strong>
					<rich:separator lineType="solid" />
					<br /> <strong>#{messages['operation_permit.assessments']}</strong>
					<rich:separator lineType="solid" />
					<br /> <br />
				</div>
			</ui:define>

			<ui:define name="permitBody">
				<h:form>
					<style type="text/css">
						.introCol1 {
							vertical-align: top;
							width: 30%;
						}
						
						.introCol2 {
							vertical-align: top;
							width: 70%;
						}
					</style>

					<div align="center">
						<ui:include src="includes/inputData/assessmentsIncl.xhtml" />
						<br /> <br /> <br />
					</div>

					<a4j:jsFunction name="finish"
						action="#{operationPermitHelper.endAssessments}">
					</a4j:jsFunction>
				</h:form>
				
				<f:subview id="vrp">
					<ui:include src="includes/viewRequestPanel.xhtml" />
				</f:subview>
			</ui:define>
		</ui:decorate>
	</ui:define>
</ui:composition>
